import request from "../request";

const baseUrl = (id) => {
  return `/admin/user` + (id ? `/${id}` : '')
}

export const AdminUserList = (params) => {
  return request.get(baseUrl(), params)
}

export const AdminRiderList = (params) => {
  return request.get('/admin/rider', params)
}

export const AdminUserInfo = (id, params) => {
  return request.get(baseUrl(id), params)
}

export const AdminUserPost = (data) => {
  return request.post(baseUrl(), data)
}

export const AdminUserPostOnlyStatus = (data) => {
  return request.post(baseUrl() + '/updatus', data)
}

export const AdminUserBindriderPost = (data) => {
  return request.post(baseUrl() + '/bindrider', data)
}

export const AdminUserUnbindriderPost = (data) => {
  return request.post(baseUrl() + '/unbindrider', data)
}

export const AdminUserStoredPost = (id, data) => {
  return request.post(baseUrl(id) + `/stored`, data)
}

export const AdminUserPut = (id, data) => {
  return request.put(baseUrl(id), data)
}

export const AdminUserDel = (id) => {
  return request.delete(baseUrl(id))
}

export const AdminUserRepassPut = (id, data) => {
  return request.put(baseUrl(id), data);
}

export const AdminUserLuckyDrawRecordGet = (params) => {
  return request.get(baseUrl() + '/lucky', params)
}

export const AdminUserLuckyDrawRecordPost = (id, data) => {
  return request.post(baseUrl() + '/lucky/' + id, data)
}
